<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/8/26
  Time: 23:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>
    <style>
        #out{
            width:500px;
            height: 400px;
            margin-left: 600px;
            margin-top: 220px;
        }
        #inner{
            width: 360px;
            border:grey 2px solid;
            margin-left: 80px;
            margin-top: 130px;
        }
        input{
            width: 120px;
            height: 35px;
        }


    </style>
</head>
<body>

<div id="out" style="border:grey 2px solid">
    <h1 style="margin-left: 160px">教务管理系统</h1>
    <div id="inner" >
        <form action="userLogin" method="post" onclick="return checkLogin()">
            <span style="margin-left: 100px">
                账号：<input type="text" id="userAccount" name="userAccount" class="myText">
            </span>

            <br><br>
            <span style="margin-left: 100px">
                密码：<input type="password" id="userPassword" name="userPassword" class="myText">
            </span><br><br>

            <input type="submit" value="登录" style="margin-left: 120px"><br>
            <span style="margin-left: 135px; color: red;font-size: 15px"id="tip">${tip}</span>

        </form>

    </div>


</div>


</body>
</html>
<script>
    function checkLogin(){
        let userAccount = document.getElementById("userAccount").value;
        let userPassword = document.getElementById("userPassword").value;
        if(userAccount==null||userAccount.trim()==""){
            document.getElementById("tip").innerHTML="账户不能为空";
            return false;
        }
        if(userPassword==null||userPassword.trim()==""){
            document.getElementById("tip").innerHTML="密码不能为空";
            return false;
        }
        return true;
    }
</script>